#Makefile for libgui

CC	= gcc
AR	= ar
RANLIB	= ranlib
LIB	= libgui.a
OBJS	= area.o button.o panel.o label.o global.o msgbox.o checker.o input.o

CFLAGS	= `sdl-config --cflags` -Wall -O4 -I../libbase
LDFLAGS	= `sdl-config --libs` -lSDL_ttf -lSDL_image -lSDL_mixer -lSDL_gfx 

.PHONY:all clean cleanbak

all:$(LIB)

$(LIB): $(DEPENDS) $(OBJS)
	$(AR) -rc $(LIB) $(OBJS)
	$(RANLIB) $(LIB)
-include $(DEPENDS)
$(DEPENDS):
	@echo -n $@ " " > $@
	@$(CC) -MM $(@:.d=.c) >> $@ $(CFLAGS)

clean:
	rm -f $(DEPENDS) $(BIN) $(LIB) $(OBJS)

cleanbak:
	rm -f *~
